3.54 \(\int x^2 \cosh ((a+b x)^2) \, dx\)

Optimal. Leaf size=113 \[ \frac{\sqrt{\pi } a^2 \text{Erf}(a+b x)}{4 b^3}+\frac{\sqrt{\pi } a^2 \text{Erfi}(a+b x)}{4 b^3}+\frac{\sqrt{\pi } \text{Erf}(a+b x)}{8 b^3}-\frac{\sqrt{\pi } \text{Erfi}(a+b x)}{8 b^3}-\frac{a \sinh \left ((a+b x)^2\right )}{b^3}+\frac{(a+b x) \sinh \left ((a+b x)^2\right )}{2 b^3} \]

[Out]

(Sqrt[Pi]*Erf[a + b*x])/(8*b^3) + (a^2*Sqrt[Pi]*Erf[a + b*x])/(4*b^3) - (Sqrt[Pi]*Erfi[a + b*x])/(8*b^3) + (a^
2*Sqrt[Pi]*Erfi[a + b*x])/(4*b^3) - (a*Sinh[(a + b*x)^2])/b^3 + ((a + b*x)*Sinh[(a + b*x)^2])/(2*b^3)

________________________________________________________________________________________

Rubi [A]  time = 0.100875, antiderivative size = 113, normalized size of antiderivative = 1., number of steps used = 12, number of rules used = 9, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.75, Rules used = {5365, 6742, 5299, 2204, 2205, 5321, 2637, 5325, 5298} \[ \frac{\sqrt{\pi } a^2 \text{Erf}(a+b x)}{4 b^3}+\frac{\sqrt{\pi } a^2 \text{Erfi}(a+b x)}{4 b^3}+\frac{\sqrt{\pi } \text{Erf}(a+b x)}{8 b^3}-\frac{\sqrt{\pi } \text{Erfi}(a+b x)}{8 b^3}-\frac{a \sinh \left ((a+b x)^2\right )}{b^3}+\frac{(a+b x) \sinh \left ((a+b x)^2\right )}{2 b^3} \]

Antiderivative was successfully verified.

[In]

Int[x^2*Cosh[(a + b*x)^2],x]

[Out]

(Sqrt[Pi]*Erf[a + b*x])/(8*b^3) + (a^2*Sqrt[Pi]*Erf[a + b*x])/(4*b^3) - (Sqrt[Pi]*Erfi[a + b*x])/(8*b^3) + (a^
2*Sqrt[Pi]*Erfi[a + b*x])/(4*b^3) - (a*Sinh[(a + b*x)^2])/b^3 + ((a + b*x)*Sinh[(a + b*x)^2])/(2*b^3)

Rule 5365

Int[((a_.) + Cosh[(c_.) + (d_.)*(u_)^(n_)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] :> Dist[1/Coefficient[u, x, 1]^(
m + 1), Subst[Int[(x - Coefficient[u, x, 0])^m*(a + b*Cosh[c + d*x^n])^p, x], x, u], x] /; FreeQ[{a, b, c, d,
n, p}, x] && LinearQ[u, x] && NeQ[u, x] && IntegerQ[m]

Rule 6742

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rule 5299

Int[Cosh[(c_.) + (d_.)*(x_)^(n_)], x_Symbol] :> Dist[1/2, Int[E^(c + d*x^n), x], x] + Dist[1/2, Int[E^(-c - d*
x^n), x], x] /; FreeQ[{c, d}, x] && IGtQ[n, 1]

Rule 2204

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[(F^a*Sqrt[Pi]*Erfi[(c + d*x)*Rt[b*Log[F], 2
]])/(2*d*Rt[b*Log[F], 2]), x] /; FreeQ[{F, a, b, c, d}, x] && PosQ[b]

Rule 2205

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[(F^a*Sqrt[Pi]*Erf[(c + d*x)*Rt[-(b*Log[F]),
 2]])/(2*d*Rt[-(b*Log[F]), 2]), x] /; FreeQ[{F, a, b, c, d}, x] && NegQ[b]

Rule 5321

Int[((a_.) + Cosh[(c_.) + (d_.)*(x_)^(n_)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simpli
fy[(m + 1)/n] - 1)*(a + b*Cosh[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IntegerQ[Sim
plify[(m + 1)/n]] && (EqQ[p, 1] || EqQ[m, n - 1] || (IntegerQ[p] && GtQ[Simplify[(m + 1)/n], 0]))

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 5325

Int[Cosh[(c_.) + (d_.)*(x_)^(n_)]*((e_.)*(x_))^(m_.), x_Symbol] :> Simp[(e^(n - 1)*(e*x)^(m - n + 1)*Sinh[c +
d*x^n])/(d*n), x] - Dist[(e^n*(m - n + 1))/(d*n), Int[(e*x)^(m - n)*Sinh[c + d*x^n], x], x] /; FreeQ[{c, d, e}
, x] && IGtQ[n, 0] && LtQ[0, n, m + 1]

Rule 5298

Int[Sinh[(c_.) + (d_.)*(x_)^(n_)], x_Symbol] :> Dist[1/2, Int[E^(c + d*x^n), x], x] - Dist[1/2, Int[E^(-c - d*
x^n), x], x] /; FreeQ[{c, d}, x] && IGtQ[n, 1]

Rubi steps

\begin{align*} \int x^2 \cosh \left ((a+b x)^2\right ) \, dx &=\frac{\operatorname{Subst}\left (\int (-a+x)^2 \cosh \left (x^2\right ) \, dx,x,a+b x\right )}{b^3}\\ &=\frac{\operatorname{Subst}\left (\int \left (a^2 \cosh \left (x^2\right )-2 a x \cosh \left (x^2\right )+x^2 \cosh \left (x^2\right )\right ) \, dx,x,a+b x\right )}{b^3}\\ &=\frac{\operatorname{Subst}\left (\int x^2 \cosh \left (x^2\right ) \, dx,x,a+b x\right )}{b^3}-\frac{(2 a) \operatorname{Subst}\left (\int x \cosh \left (x^2\right ) \, dx,x,a+b x\right )}{b^3}+\frac{a^2 \operatorname{Subst}\left (\int \cosh \left (x^2\right ) \, dx,x,a+b x\right )}{b^3}\\ &=\frac{(a+b x) \sinh \left ((a+b x)^2\right )}{2 b^3}-\frac{\operatorname{Subst}\left (\int \sinh \left (x^2\right ) \, dx,x,a+b x\right )}{2 b^3}-\frac{a \operatorname{Subst}\left (\int \cosh (x) \, dx,x,(a+b x)^2\right )}{b^3}+\frac{a^2 \operatorname{Subst}\left (\int e^{-x^2} \, dx,x,a+b x\right )}{2 b^3}+\frac{a^2 \operatorname{Subst}\left (\int e^{x^2} \, dx,x,a+b x\right )}{2 b^3}\\ &=\frac{a^2 \sqrt{\pi } \text{erf}(a+b x)}{4 b^3}+\frac{a^2 \sqrt{\pi } \text{erfi}(a+b x)}{4 b^3}-\frac{a \sinh \left ((a+b x)^2\right )}{b^3}+\frac{(a+b x) \sinh \left ((a+b x)^2\right )}{2 b^3}+\frac{\operatorname{Subst}\left (\int e^{-x^2} \, dx,x,a+b x\right )}{4 b^3}-\frac{\operatorname{Subst}\left (\int e^{x^2} \, dx,x,a+b x\right )}{4 b^3}\\ &=\frac{\sqrt{\pi } \text{erf}(a+b x)}{8 b^3}+\frac{a^2 \sqrt{\pi } \text{erf}(a+b x)}{4 b^3}-\frac{\sqrt{\pi } \text{erfi}(a+b x)}{8 b^3}+\frac{a^2 \sqrt{\pi } \text{erfi}(a+b x)}{4 b^3}-\frac{a \sinh \left ((a+b x)^2\right )}{b^3}+\frac{(a+b x) \sinh \left ((a+b x)^2\right )}{2 b^3}\\ \end{align*}

Mathematica [A]  time = 0.124094, size = 62, normalized size = 0.55 \[ \frac{\sqrt{\pi } \left (2 a^2+1\right ) \text{Erf}(a+b x)+\sqrt{\pi } \left (2 a^2-1\right ) \text{Erfi}(a+b x)-4 (a-b x) \sinh \left ((a+b x)^2\right )}{8 b^3} \]

Antiderivative was successfully verified.

[In]

Integrate[x^2*Cosh[(a + b*x)^2],x]

[Out]

((1 + 2*a^2)*Sqrt[Pi]*Erf[a + b*x] + (-1 + 2*a^2)*Sqrt[Pi]*Erfi[a + b*x] - 4*(a - b*x)*Sinh[(a + b*x)^2])/(8*b
^3)

________________________________________________________________________________________

Maple [C]  time = 0.045, size = 136, normalized size = 1.2 \begin{align*} -{\frac{x{{\rm e}^{- \left ( bx+a \right ) ^{2}}}}{4\,{b}^{2}}}+{\frac{a{{\rm e}^{- \left ( bx+a \right ) ^{2}}}}{4\,{b}^{3}}}+{\frac{{a}^{2}{\it Erf} \left ( bx+a \right ) \sqrt{\pi }}{4\,{b}^{3}}}+{\frac{{\it Erf} \left ( bx+a \right ) \sqrt{\pi }}{8\,{b}^{3}}}+{\frac{x{{\rm e}^{ \left ( bx+a \right ) ^{2}}}}{4\,{b}^{2}}}-{\frac{a{{\rm e}^{ \left ( bx+a \right ) ^{2}}}}{4\,{b}^{3}}}-{\frac{{\frac{i}{4}}{a}^{2}\sqrt{\pi }{\it Erf} \left ( ibx+ia \right ) }{{b}^{3}}}+{\frac{{\frac{i}{8}}\sqrt{\pi }{\it Erf} \left ( ibx+ia \right ) }{{b}^{3}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*cosh((b*x+a)^2),x)

[Out]

-1/4/b^2*x*exp(-(b*x+a)^2)+1/4*a/b^3*exp(-(b*x+a)^2)+1/4*a^2*erf(b*x+a)*Pi^(1/2)/b^3+1/8*erf(b*x+a)*Pi^(1/2)/b
^3+1/4/b^2*x*exp((b*x+a)^2)-1/4*a/b^3*exp((b*x+a)^2)-1/4*I*a^2/b^3*Pi^(1/2)*erf(I*b*x+I*a)+1/8*I/b^3*Pi^(1/2)*
erf(I*b*x+I*a)

________________________________________________________________________________________

Maxima [B]  time = 1.61732, size = 1195, normalized size = 10.58 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*cosh((b*x+a)^2),x, algorithm="maxima")

[Out]

1/3*x^3*cosh((b*x + a)^2) + 1/6*((sqrt(pi)*(b^2*x + a*b)*a^3*b^3*(erf(sqrt(-(b^2*x + a*b)^2/b^2)) - 1)/((b^2)^
(7/2)*sqrt(-(b^2*x + a*b)^2/b^2)) - 3*a^2*b^4*e^((b^2*x + a*b)^2/b^2)/(b^2)^(7/2) + b^4*gamma(2, -(b^2*x + a*b
)^2/b^2)/(b^2)^(7/2) - 3*(b^2*x + a*b)^3*a*b*gamma(3/2, -(b^2*x + a*b)^2/b^2)/((b^2)^(7/2)*(-(b^2*x + a*b)^2/b
^2)^(3/2)))*a/sqrt(b^2) - (sqrt(pi)*(b^2*x + a*b)*a^3*b^3*(erf(sqrt((b^2*x + a*b)^2/b^2)) - 1)/((-b^2)^(7/2)*s
qrt((b^2*x + a*b)^2/b^2)) + 3*a^2*b^4*e^(-(b^2*x + a*b)^2/b^2)/(-b^2)^(7/2) + b^4*gamma(2, (b^2*x + a*b)^2/b^2
)/(-b^2)^(7/2) - 3*(b^2*x + a*b)^3*a*b*gamma(3/2, (b^2*x + a*b)^2/b^2)/((-b^2)^(7/2)*((b^2*x + a*b)^2/b^2)^(3/
2)))*a/sqrt(-b^2) - (sqrt(pi)*(b^2*x + a*b)*a^4*b^4*(erf(sqrt((b^2*x + a*b)^2/b^2)) - 1)/((-b^2)^(9/2)*sqrt((b
^2*x + a*b)^2/b^2)) + 4*a^3*b^5*e^(-(b^2*x + a*b)^2/b^2)/(-b^2)^(9/2) + 4*a*b^5*gamma(2, (b^2*x + a*b)^2/b^2)/
(-b^2)^(9/2) - 6*(b^2*x + a*b)^3*a^2*b^2*gamma(3/2, (b^2*x + a*b)^2/b^2)/((-b^2)^(9/2)*((b^2*x + a*b)^2/b^2)^(
3/2)) - (b^2*x + a*b)^5*gamma(5/2, (b^2*x + a*b)^2/b^2)/((-b^2)^(9/2)*((b^2*x + a*b)^2/b^2)^(5/2)))*b/sqrt(-b^
2) - (sqrt(pi)*(b^2*x + a*b)*a^4*b^4*(erf(sqrt(-(b^2*x + a*b)^2/b^2)) - 1)/((b^2)^(9/2)*sqrt(-(b^2*x + a*b)^2/
b^2)) - 4*a^3*b^5*e^((b^2*x + a*b)^2/b^2)/(b^2)^(9/2) + 4*a*b^5*gamma(2, -(b^2*x + a*b)^2/b^2)/(b^2)^(9/2) - 6
*(b^2*x + a*b)^3*a^2*b^2*gamma(3/2, -(b^2*x + a*b)^2/b^2)/((b^2)^(9/2)*(-(b^2*x + a*b)^2/b^2)^(3/2)) - (b^2*x
+ a*b)^5*gamma(5/2, -(b^2*x + a*b)^2/b^2)/((b^2)^(9/2)*(-(b^2*x + a*b)^2/b^2)^(5/2)))*b/sqrt(b^2))*b

________________________________________________________________________________________

Fricas [A]  time = 1.85993, size = 382, normalized size = 3.38 \begin{align*} \frac{{\left (\sqrt{\pi }{\left (2 \, a^{2} + 1\right )} \sqrt{b^{2}} \operatorname{erf}\left (\frac{\sqrt{b^{2}}{\left (b x + a\right )}}{b}\right ) e^{\left (b^{2} x^{2} + 2 \, a b x + a^{2}\right )} + \sqrt{\pi }{\left (2 \, a^{2} - 1\right )} \sqrt{b^{2}} \operatorname{erfi}\left (\frac{\sqrt{b^{2}}{\left (b x + a\right )}}{b}\right ) e^{\left (b^{2} x^{2} + 2 \, a b x + a^{2}\right )} - 2 \, b^{2} x + 2 \, a b + 2 \,{\left (b^{2} x - a b\right )} e^{\left (2 \, b^{2} x^{2} + 4 \, a b x + 2 \, a^{2}\right )}\right )} e^{\left (-b^{2} x^{2} - 2 \, a b x - a^{2}\right )}}{8 \, b^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*cosh((b*x+a)^2),x, algorithm="fricas")

[Out]

1/8*(sqrt(pi)*(2*a^2 + 1)*sqrt(b^2)*erf(sqrt(b^2)*(b*x + a)/b)*e^(b^2*x^2 + 2*a*b*x + a^2) + sqrt(pi)*(2*a^2 -
 1)*sqrt(b^2)*erfi(sqrt(b^2)*(b*x + a)/b)*e^(b^2*x^2 + 2*a*b*x + a^2) - 2*b^2*x + 2*a*b + 2*(b^2*x - a*b)*e^(2
*b^2*x^2 + 4*a*b*x + 2*a^2))*e^(-b^2*x^2 - 2*a*b*x - a^2)/b^4

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int x^{2} \cosh{\left (a^{2} + 2 a b x + b^{2} x^{2} \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*cosh((b*x+a)**2),x)

[Out]

Integral(x**2*cosh(a**2 + 2*a*b*x + b**2*x**2), x)

________________________________________________________________________________________

Giac [C]  time = 1.31815, size = 185, normalized size = 1.64 \begin{align*} -\frac{\frac{i \, \sqrt{\pi }{\left (2 \, a^{2} - 1\right )} \operatorname{erf}\left (i \, b{\left (x + \frac{a}{b}\right )}\right )}{b} - \frac{2 \,{\left (b{\left (x + \frac{a}{b}\right )} - 2 \, a\right )} e^{\left (b^{2} x^{2} + 2 \, a b x + a^{2}\right )}}{b}}{8 \, b^{2}} - \frac{\frac{\sqrt{\pi }{\left (2 \, a^{2} + 1\right )} \operatorname{erf}\left (-b{\left (x + \frac{a}{b}\right )}\right )}{b} + \frac{2 \,{\left (b{\left (x + \frac{a}{b}\right )} - 2 \, a\right )} e^{\left (-b^{2} x^{2} - 2 \, a b x - a^{2}\right )}}{b}}{8 \, b^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*cosh((b*x+a)^2),x, algorithm="giac")

[Out]

-1/8*(I*sqrt(pi)*(2*a^2 - 1)*erf(I*b*(x + a/b))/b - 2*(b*(x + a/b) - 2*a)*e^(b^2*x^2 + 2*a*b*x + a^2)/b)/b^2 -
 1/8*(sqrt(pi)*(2*a^2 + 1)*erf(-b*(x + a/b))/b + 2*(b*(x + a/b) - 2*a)*e^(-b^2*x^2 - 2*a*b*x - a^2)/b)/b^2